package com.school.adminServlet.cmd;

import java.io.IOException;
import java.util.ArrayList;
import java.util.logging.Logger;

import javax.servlet.RequestDispatcher;
import javax.servlet.ServletConfig;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.school.dao.AttendanceManagerDao;
import com.school.dao.AttendanceManagerDaoImpl;

public class GetStusentListCommand implements AdminCommand {
	
	public static Logger log = Logger.getLogger(GetStusentListCommand.class.getSimpleName());
	@Override
	public void processRequest(HttpServletRequest req,
			HttpServletResponse resp, ServletConfig config)
			throws ServletException, IOException {
		log.info("entered processRequest()");
		
		resp.setContentType("application/json");
		resp.setHeader("Cache-Control", "no-cache");
		/*resp.getWriter().print(makeJson());
		log.info("Exited in City List PRocessreq()");
	}
	private String makeJson(ArrayList<City> cityList) {

		StringBuilder builder = new StringBuilder(200);

		builder.append("var jsonObject = { 'cities' : [");

		for (City city : cityList) {

			builder.append("{");

			builder.append("'");
			builder.append("id");
			builder.append("'");
			builder.append(":");
			builder.append("'");
			builder.append(city.getCityId());
			builder.append("'");
			builder.append(",");

			builder.append("'");
			builder.append("name");
			builder.append("'");
			builder.append(":");
			builder.append("'");
			builder.append(city.getCityName());
			builder.append("'");

			builder.append("}");
			builder.append(",");;

		}

		builder.append("]};");

		return builder.toString();
	}
		
		log.info("exited processRequest()");
*/}
}

